/*
 * @Date: 2020-08-27 14:50:30
 */
import React, { Component } from 'react'
import { BrowserRouter as Router, Route, Link, Switch } from 'react-router-dom'
export default class Routerpage extends Component {
  render() {
    return (
      <div>
        <Router>
          <Link to="/">⾸首⻚页</Link>
          <Link to="/user">⽤用户中⼼心</Link>
          <Switch>
            <Route
              exact
              path="/"
              component={HomePage}
            />
            <Route path="/user" component={UserPage} />

            <Route component={NoPage}></Route>
          </Switch>
        </Router>
      </div>
    )
  }
}
class HomePage extends Component {
  render() {
    return (
      <div>
        Home
      </div>
    )
  }
}
class UserPage extends Component {
  render() {
    return (
      <div>
        User
      </div>
    )
  }
}
class NoPage extends Component {
  render() {
    return (
      <div>
        404
      </div>
    )
  }
}
